﻿<Page x:Class="WinChrome.View.HomePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:viewModel="clr-namespace:WinChrome.ViewModel" 
      xmlns:Convertors="clr-namespace:WinChrome.Convertors"
      xmlns:WinChrome="clr-namespace:WinChrome;assembly=WinChrome"
      mc:Ignorable="d" 
      d:DesignHeight="400" d:DesignWidth="600"
	Title="Welcome to the WinChrome Windows 7 Demo" d:DataContext="{d:DesignInstance Type=viewModel:RootViewModel}">

    <!--
    <view:NavigationPage.Alert>
    </view:NavigationPage.Alert>
-->
    <Page.Resources>
        <Convertors:InvisibleOnStringEmptyConverter x:Key="invisibiltyOnStringEmptyConverter"/>
    </Page.Resources>


    <StackPanel Margin="12" >
       
        <TextBlock TextWrapping="Wrap" Margin="0,3" FontWeight="Bold"
                    Text="Try using search in the top right corner"/>

        <TextBlock Visibility="{Binding Path=SearchText, 
            RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type WinChrome:StyledWindow}}, 
            Converter={StaticResource ResourceKey=invisibiltyOnStringEmptyConverter}}">
            <Run>You searched for:</Run>
            <Run Text="{Binding Path=SearchText, 
                RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type WinChrome:StyledWindow}}}"/>
        </TextBlock>
        
    </StackPanel>
</Page>
